<?php
App::uses('AppModel', 'Model');
/**
 * User Model
 *
 */
class Broker extends AppModel {

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'company_name';

 public $useTable = 'broker';

    public $actsAs = array(
            'MeioUpload.MeioUpload' => array(
              'image' => array('dir' => 'files/user','length' => array(
			'minWidth' => 250, // 0 for not validates
			'maxWidth' => 1280,
			'minHeight' => 300,
			'maxHeight' => 1080
		),'thumbsizes' => array('thumb' => array('width' => 600, 'height' => 400))),
          )
        );


/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'facebook' => array(
			'url' => array(
				'rule' => array('url'),
				'message' => 'Invalid URL',
				'allowEmpty' => true,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'twitter' => array(
			'url' => array(
				'rule' => array('url'),
				'message' => 'Invalid URL',
				'allowEmpty' => true,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'google_plus' => array(
			'url' => array(
				'rule' => array('url'),
				'message' => 'Invalid URL',
				'allowEmpty' => true,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'linkedin' => array(
			'url' => array(
				'rule' => array('url'),
				'message' => 'Invalid URL',
				'allowEmpty' => true,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
			)
	);

}
